<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<title>Miranda IM Plugins Subversion Repository</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="shortcut icon" href="readme/favicon.ico" />
	<link rel="stylesheet" type="text/css" href="readme/readme.css" />
</head>
<body>
<div id="wrapper">
	<div id="banner"><span><a href="http://www.miranda-im.org/"><img src="Readme/mim_logo.gif" alt="Miranda IM" height="44" width="90" /></a></span></div>
	<ul id="navbar">
		<li><a href="readme.html">General</a></li>
		<li><a href="" class="active">Standards</a></li>
	</ul>
	<div id="page-info"><h1>Miranda IM Plugin Development Standards</h1><h2>We don't need mess, right?</h2></div>
	<div id="content">
<!-- content begin -->
<p>From the very outset you have to choose your "plugin name" which will be used everywhere. Also think through if you need trunk/tags/branches topology or not.</p>
<h3>File Layout</h3>
<p>Layout for pascal/delphi plugins is still missing, it's subject to be added later. Designation "&lt;plugin&gt;" means mentioned above plugin handle (use lowercase if possible). I've taken Extended UserInfo as an example (handle "uinfoex").</p>
<div class="list">
	<p><a href="http://mim-plugins.googlecode.com/svn/c/">root\c\</a> – c/c++ plugins;</p>
	<p><a href="http://mim-plugins.googlecode.com/svn/c/common/include/">root\c\common\include\m_&lt;header-name&gt;.h</a> – general name format for any MIM header stored in header 'warehouse'. If possible, use &lt;plugin&gt; for &lt;header-name&gt;;</p>
	<p><a href="http://mim-plugins.googlecode.com/svn/c/plugins/uinfoex/">root\c\plugins\&lt;plugin&gt;\trunk\&lt;plugin&gt;_&lt;C version&gt;.&lt;extension&gt;</a> – folder for all kind of project files (&lt;C version&gt; is 2-digit - e.g. 60, 71, 80);</p>
	<p><a href="http://mim-plugins.googlecode.com/svn/c/plugins/uinfoex/docs/">root\c\plugins\&lt;plugin&gt;\trunk\docs\&lt;plugin&gt;_&lt;doctype&gt;.&lt;extension&gt;</a> – general document filename format (&lt;doctype&gt; is [readme/changelog/...]);</p>
	<p><a href="http://mim-plugins.googlecode.com/svn/c/plugins/uinfoex/src/">root\c\plugins\&lt;plugin&gt;\trunk\src\</a> – folder for source files;</p>
	<p><a href="http://mim-plugins.googlecode.com/svn/c/plugins/uinfoex/res/">root\c\plugins\&lt;plugin&gt;\trunk\res\</a> – folder for resource files;</p>
	<p><a href="http://mim-plugins.googlecode.com/svn/pascal/">root\pascal\</a> – pascal/delphi plugins</p>
	<p>...</p>
</div>
<h3>Project Settings</h3>
<p>To keep folder structure (and everything beyond it) clear project files need to follow some rules too (however, some of them are not obligatory).</p>
<p>Solution and general project options:</p>
<div class="list">
	<p>Plugin project name: "&lt;plugin&gt;";</p>
	<p>Iconpack project name: "&lt;plugin&gt;_icons";</p>
	<p>Configuration names for plugins in general: "[Debug/Release] [ANSI/Unicode][/ Static]";</p>
	<p>Configuration names for 2-in-1 plugins: "[Debug/Release][/ Static]";</p>
	<p>Configuration name for iconpacks: "Release";</p>
	<p>Output directory for plugins: "$(SolutionDir)bin_&lt;C version&gt; ($(ConfigurationName))\plugins";</p>
	<p>Output directory for iconpacks: "$(SolutionDir)bin_&lt;C version&gt; ($(ConfigurationName))\icons";</p>
	<p>Intermediate directory: "$(SolutionDir)bin_&lt;C version&gt; ($(ConfigurationName))\obj\$(ProjectName)";</p>
	<p>Additional include directories: "..\..\..\common\include";</p>
	<p>Output file: "$(OutDir)\$(ProjectName).dll";</p>
</div>
<p>Some recommendations to project settings. If you'll follow them, debug configurations will be configured for maximum build speed, release builds – for the most optimized dll. Both include debug database as output.</p>
<p>C/C++ options:</p>
<div class="list">
	<p>Debug information format: "Program Database for Edit & Continue" [Debug] or "Program Database" [Release];</p>
	<p>Optimization: "Disabled" [Debug] or "Minimize Size"/"Full Optimization" [Release];</p>
	<p>Global Optimizations: "No" [Debug] or "Yes" [Release];</p>
	<p>Enable string pooling: "No" [Debug] or "Yes" [Release];</p>
	<p>Enable minimal rebuild: "Yes" [Debug] or "No" [Release];</p>
	<p>Create/use precompiled header: "Yes" (if possible), location: "$(IntDir)\$(TargetName).pch";</p>
	<p>Output Files: should be placed into intermediate directory "$(IntDir)\";</p>
</div>
<p>Linker options:</p>
<div class="list">
	<p>Enable incremental linking: "Yes" [Debug] or "No" [Release];</p>
	<p>Generate Debug Info: "Yes";</p>
	<p>Generate program database file: "$(TargetDir)$(TargetName).pdb";</p>
	<p>Generate map file: "Yes";</p>
	<p>Map file name: "$(IntDir)\$(TargetName).map";</p>
	<p>References: "Default" [Debug] or "Eliminate unreferenced data" [Release];</p>
	<p>Enable COMDAT Folding: "Default" [Debug] or "Remove Redundant COMDATs" [Release];</p>
	<p>Optimize for windows 98: "No";</p>
	<p>Import library: "$(IntDir)\$(TargetName).lib";</p>
	<p>Target machine: "MachineX86";</p>
</div>
<h3>Commiting changes</h3>
<p>When you're commiting anything, please write what this commit contains in following format:</p>
<div class="monospace">
	<p>[&lt;plugin&gt;] 1st string</p>
	<p>2nd string</p>
	<p>...</p>
</div>
<p>Prepend "*" if string describes change, "+" for any addition, "-" for removal of something, "!" when it's bugfix;</p>
<div class="monospace">
	<p>[clist_classic] ! fixed old bug which suppressed contact online notifications</p>
	<p>+ added TopToolBar support</p>
	<p>* changed clist behaviour: now it hides/shows after single click on tray icon</p>
	<p>- removed "single click interface" option</p>
</div>
<h3>Code</h3>
<p>Comment your code when you write it. Use english language everywhere (including comments), neutral language for resources w/o any strings and appropriate language for resources containing language-dependant content.</p>
<p>Without doubts, these rules are subject to discuss and to change. I've written them with my experience in mind, and I think that lots of things may be improved.</p>
<h3>Todo</h3>
<div class="list">
	<p>Add delphi/pascal folder structure and describe it here.</p>
	<p>Attach one more HDD to install MSVS 2k5 and VC 6.0, probably some other development environments;</p>
	<p>Import as much plugins as possible;</p>
	<p>Ask any native english-speaker to rewrite/correct/stylize this document, it may contain awful mistakes;</p>
	<p>Probably add section with certain coding style recommendations</p>
</div>
<!-- content end -->
	</div>
	<div id="footer">
<p>Design by <a href="http://www.robert-rainwater.com/">Robert Rainwater</a></p>
	</div>
</div>
</body></html>